Skip to content

Conversation

holaontiveros
Copy link

@holaontiveros holaontiveros commented Oct 9, 2025

Description

This PR adds a new view for the v2 libraries which will allow the user to export a backup of the library for later import.

Useful information to include:

  • This change should add new features for the course authors

Before new dropdown was added:
image

New dropdown on v2 libraries for tools:
image

Backup page:
image

Supporting information

Covers the first part of #2448
Implements the first part of the views this figma design

Testing instructions

Assuming you have a working authoring dev environment and you have the right version of the edx-platform (latest master which includes: openedx/edx-platform#37419)

  • Change to this branch
  • Go to a v2 library and verify the Tools dropdown is present
  • Access the backup option
  • While at the new scren try to do a backup of your library

Other information

Include anything else that will help reviewers and consumers understand the change.

  • This depends on changes on edx-platform to add the new endpoints required for the backup process, those changes were added in -> feat: Libraries v2 backup endpoint edx-platform#37419
  • This only covers the backup part the restorewill be handled in a different PR for clearness

Best Practices Checklist

We're trying to move away from some deprecated patterns in this codebase. Please
check if your PR meets these recommendations before asking for a review:

  • Any new files are using TypeScript (.ts, .tsx).
  • Deprecated propTypes, defaultProps, and injectIntl patterns are not used in any new or modified code.
  • Tests should use the helpers in src/testUtils.tsx (specifically initializeMocks)
  • Do not add new fields to the Redux state/store. Use React Context to share state among multiple components.
  • Use React Query to load data from REST APIs. See any apiHooks.ts in this repo for examples.
  • All new i18n messages in messages.ts files have a description for translators to use.
  • Imports avoid using ../. To import from parent folders, use @src, e.g. import { initializeMocks } from '@src/testUtils'; instead of from '../../../../testUtils'

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Oct 9, 2025
@openedx-webhooks
Copy link

openedx-webhooks commented Oct 9, 2025

Thanks for the pull request, @holaontiveros!

This repository is currently maintained by @bradenmacdonald.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.


Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@github-project-automation github-project-automation bot moved this to Needs Triage in Contributions Oct 9, 2025
@holaontiveros holaontiveros force-pushed the feat/librariesv2-backup-page branch from 5d2d2b7 to e6ef987 Compare October 14, 2025 15:26
@holaontiveros holaontiveros force-pushed the feat/librariesv2-backup-page branch from e6ef987 to 70aefaa Compare October 14, 2025 16:25
Copy link

codecov bot commented Oct 14, 2025

Codecov Report

❌ Patch coverage is 96.32353% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.74%. Comparing base (8b6a350) to head (43016d7).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...ary-authoring/backup-restore/LibraryBackupPage.tsx 94.38% 5 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           master    #2532    +/-   ##
========================================
  Coverage   94.74%   94.74%            
========================================
  Files        1206     1212     +6     
  Lines       27042    27169   +127     
  Branches     5922     6106   +184     
========================================
+ Hits        25620    25742   +122     
- Misses       1364     1369     +5     
  Partials       58       58            

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mphilbrick211 mphilbrick211 added the mao-onboarding Reviewing this will help onboard devs from an Axim mission-aligned organization (MAO). label Oct 15, 2025
@mphilbrick211 mphilbrick211 moved this from Needs Triage to Waiting on Author in Contributions Oct 15, 2025
@holaontiveros holaontiveros marked this pull request as ready for review October 16, 2025 16:48
Copy link
Contributor

@bradenmacdonald bradenmacdonald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks fine, though I have some suggestions for making the tests more consistent with the other new tests in our codebase. Most of this is optional feedback so don't feel you have to change every single thing I pointed out.

Comment on lines 24 to 28
const mockLibraryData: { data: any } = { data: {} };

jest.mock('@src/library-authoring/data/apiHooks', () => ({
useContentLibrary: () => (mockLibraryData),
}));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may be fine but I'd usually recommend the more realistic mock data helpers that we have:

import { mockContentLibrary } from '../data/api.mocks';
mockContentLibrary.applyMock();

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did try this one, but somehow the mocks don't apply properly, so the libraryData it's always undefined... not sure why exactly becasue it works in other places that have the exact same scenario... so I'll leave it as is for now

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right?, I can show you if you want, maybe it's just me after seing the tests for too long 🤷‍♂️

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's fine for now :p

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mao-onboarding Reviewing this will help onboard devs from an Axim mission-aligned organization (MAO). open-source-contribution PR author is not from Axim or 2U

Projects

Status: Waiting on Author

Development

Successfully merging this pull request may close these issues.

6 participants